package search.impl;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.SocketException;
import java.net.URL;

public class GetAll
{
	public String getAllHtml(String webUrl) throws IOException
	{
		do
		{
			try
			{
				URL url = new URL(webUrl);
				HttpURLConnection connection = null;
				connection = (HttpURLConnection) url.openConnection();
				BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
				StringBuilder builder = new StringBuilder();
				String s;
				while ((s = reader.readLine()) != null)
				{
					builder.append(s);
				}
				return builder.toString();
			}
			catch (SocketException socketE)
			{
				System.out.println("Connection reset");
			}
		} while (true);
	}
}
